<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../node_modules/axios/dist/axios.min.js"></script>
</head>
<body>
  
    <button>添加</button>
   
    <script>
        let btn = document.querySelectorAll('button')
        btn[0].addEventListener('click', ()=>{
            axios({
                method:'POST',
                baseURL:"http://api.liu.com:3000",
                url:'/students',
                data:{
                    name:'小白',
                    age:29
                },
                headers:{
                    a:12
                },
                params:{
                    sex:'nnnnn'
                }
            })
        })

        
    </script>

</body>
</html>